
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    {include file="public/head" /}
    <title>{block name="title"}{/block}</title>
    {block name="head"}{/block}
</head>
<body class="gray-bg">
    <div class="am-g tpl-g">
        <!-- 头部 -->
        <header class="tpl-header">
            <!-- 右侧内容 -->
            <div class="tpl-header-fluid">
                <!-- 侧边切换 -->
                <div class="am-fl tpl-header-button switch-button">
                    <i class="iconfont icon-menufold"></i>
                </div>
                <!-- 刷新页面 -->
                <div class="am-fl tpl-header-button refresh-button">
                    <i class="iconfont icon-refresh"></i>
                </div>
                <!-- 其它功能-->
                <div class="am-fr tpl-header-navbar" style="float: right;">
                    <ul>
                        <!-- 欢迎语 -->
                        <li class="am-text-sm tpl-header-navbar-welcome">
                            <a href="/index.php/store/store.user/renew">欢迎你，<span>admin</span>
                            </a>
                        </li>
                        <!-- 退出 -->
                        <li class="am-text-sm">
                            <a href="/index.php/store/passport/logout">
                                <i class="iconfont icon-tuichu"></i> 退出
                            </a>
                        </li>
                    </ul>
                </div>
            </div>
        </header>
        <!-- 侧边导航栏 -->
        <div class="left-sidebar dis-flex">
                    <!-- 一级菜单 -->
            <ul class="sidebar-nav">
                <li class="sidebar-nav-heading">管理中心</li>
                    {volist name="menus" id="v"}
                    <li class="sidebar-nav-link">
                    <a href="{$v.url? ($v.url) : 'javascript:void(0);'}"   class="{if $group == $v.controller}active{/if}">
                        <i class="layui-icon {$v.icon}" style ="{$v.color? 'color' : ''}"></i>
                        &nbsp;&nbsp;{$v.menu_name}
                    </a>
                    </li>
                    {/volist}
            </ul>
            
            <!-- 子级菜单-->
            {if count($menus[$top_id]['child']) > 0}
            <ul class="left-sidebar-second">
                <li class="sidebar-second-title" >{$menus[$top_id]['menu_name']}</li>
                <li class="sidebar-second-item">
                    {volist name="menus[$top_id]['child']" id="vv"}
                        {if !isset($vv.child) || !count($vv.child)}
                            <!-- 二级菜单-->
                        <a href="{$vv.url}"   style="font-size: 14px" class="{if $group.$action == ($vv.controller).($vv.action)}active{/if}">
                            {$vv.menu_name}
                        </a>
                        {else /}
                            <!-- 三级菜单-->
                            <div class="sidebar-third-item">
                                <a href="javascript:void(0);" class="sidebar-nav-sub-title active">
                                    <i class="iconfont icon-caret"></i>
                                    {$vv.menu_name}
                                </a>
                                <ul class="sidebar-third-nav-sub">
                                    {volist name="$vv.child" id="vvv"}
                                        <li>
                                            <a class="{if $routeUri == ($vvv.controller).'/'.($vvv.action)}active{/if}"  href="{$vvv.url}">
                                                &nbsp;&nbsp;{$vvv.menu_name}</a>
                                        </li>
                                    {/volist}
                                </ul>
                            </div>
                        {/if}
                    {/volist}
                </li>
            </ul>
            {/if}
        </div>
    
        <!-- 内容区域 start -->
        <div class="tpl-content-wrapper {if !isset($menus[$top_id]['child']) || !count($menus[$top_id]['child'])}no-sidebar-second{/if}">
            <div class="row-content">
                <div class="layui-row" style="background: #fff;padding: 10px">
                        {block name="content"}{/block}
                </div>     
            </div>        
        </div>
    

            <!-- 内容区域 end -->
    </div>

{include file="public/foot" /}
{block name="script"}{/block}
<script>
    $('sidebar-nav-link a').click(function(){
        $(this).addClass('active');
    })
</script>
</body>
</html>
